package com.sdry.web.controller.lz;
import java.io.IOException;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.sdry.entity.lz.DayTask;
import com.sdry.entity.lz.Project;
import com.sdry.service.lz.TaskService;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
/**
 * 
 * @ClassName:
 * @Description:
 * @Author:lz
 * @Date:
 * @Version: 1.0
 */
@Controller
@RequestMapping("/Task")
public class TaskController {

	@Resource
	TaskService taskService;
	
	@RequestMapping("/queryTask")
	public void queryTask(HttpServletRequest request, HttpServletResponse response) throws IOException{
		response.setCharacterEncoding("UTF-8");
		String name = request.getParameter("name");
		String code = request.getParameter("code");
		String page = request.getParameter("page");
		String pageSize = request.getParameter("rows");
		System.out.println(name+","+code+","+page+","+pageSize);
		List<DayTask> taskList = taskService.queryTask();
		JSONObject config = new JSONObject();
		JSONArray jsonArray = JSONArray.fromObject(taskList);
		config.put("rows", jsonArray);
		config.put("total", 1);
		response.getWriter().println(config);
	}
}
